package com.seewintech.framework.controller;

import com.seewintech.framework.mqtt.MqttGateway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author by xiaoTian
 * @date 2022/6/17.
 */

@RestController
@RequestMapping("/mqttDemo")
public class MqttController {


    @Resource
    private MqttGateway mqttGateway;

    @RequestMapping("/sendMqtt/{data}")
    public String sendMqtt(@PathVariable("data") String  data) {
        mqttGateway.sendToMqtt(data, "hello");
        return "OK";
    }


}
